var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-5362527-3']);_gaq.push(['_trackPageview']);

function v(vi,vu,vc,va){
$("form").validate({submitHandler:function(form){
if(vu=='s')form.submit(); 
vd='';for(i=1;i<vi+1;i++)vd+="&v"+i+"="+$("#v"+i).val();
if(va==1)$('input').each(function(){if($(this).attr('id')=='chk')vd+="&v[]="+$(this).val()});
a(vu,vd,vc)}})}

function a(vu,vd,vc){$.ajax({type:"POST",url:vu,data:vd,success:function(msg){$('#'+vc).html(msg)}})}

function fillopt(d,t,v){
$("#"+d)[0].options.add(new Option(t,v))}
function fillsel(d,c,fs,t){
switch(t){
case 1:y=new Date().getFullYear();for(i=y;i>1899;i--)fillopt(d,i,i);break;
case 2:for(i=1;i<13;i++)fillopt(d,i,i);break;
case 3:$('#'+d).html('');for(i=1;i<new Date($('#v1').val(),$('#v2').val(),0).getDate()+1;i++)fillopt(d,i,i);break;
default:
p=c.split('|');
q=p[0].split(',');
r=p[1].split(',');
r.unshift('Select One');
q.unshift('');
k=parseInt(d.substr(1));l=0;
for(j=k;j<fs.length+k;j++){for(i=0;i<q.length-1;i++)fillopt('v'+j,r[i],q[i]);$('#v'+j).val(fs[l]).attr('selected',true);l++}}}